package com.programmingeyeclient.carousel.controller;



import com.programmingeyeclient.carousel.entity.Employment;
import com.programmingeyeclient.carousel.service.EmploymentService;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

/**
 * 控制层
 */
@RestController
@AllArgsConstructor
@RequestMapping("/carousel")
@CrossOrigin
@Api(value = "轮播图", tags = "轮播图接口")
public class EmploymentController {
    @Autowired
    private EmploymentService employmentService;

    //查询
    @GetMapping("/employment")
    public List<Employment> list(){
//        List<Employment> lunbo = employmentService.AllLunBo();
//        ModelAndView modelAndView = new ModelAndView();
//        modelAndView.addObject("lunbo",lunbo);
        System.out.println("轮播图:-------------"+employmentService.AllLunBo());
        return employmentService.AllLunBo();
    }
}
